package com.service.impl;

import com.mapper.OrderMapper;
import com.pojo.Orders;
import com.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;
    public boolean delOrder(int oid) {
        int i = orderMapper.delOrder(oid);
        if (i>0){
            return true;
        }
        return false;
    }

    public boolean updateOrder(Orders orders) {
        int i = orderMapper.updateOrder(orders);
        if (i>0){
            return true;
        }
        return false;
    }

    public boolean updateOrderStatus(int oid) {
        int i = orderMapper.updateOrderStatus(oid);
        if (i>0){
            return true;
        }
        return false;
    }

    public boolean delOrderDetailByOid(int oid) {
        int i = orderMapper.delOrderDetail(oid);
        if (i>0){
            return true;
        }
        return false;
    }
}
